<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.hrms.pojo.InviteJob" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>分页显示招聘信息页面</title>
<script type="text/javascript" src="<%=request.getContextPath()%>/jquery-3.1.1.min.js"></script>
<script type="text/javascript">
	function isDel(){
		return confirm("确定删除吗?");
	}
	function checkinput() {
		var nubmer = $("#showPage").val();
		if (isNaN(nubmer)) {
		alert("请输入数字");
		$("#showPage").val("");
		return false;
		}
		return true;
	}
</script>	
</head>
<body>
	
	<table align="center" border="1px" style="border-collapse:collapse;">
		<caption style="font-size:30px;font:bold;">招聘信息详细信息</caption>
		<tr>
			<th>id</th>
			<th>姓名</th>
			<th>性别</th>
			<th>年龄</th>
			<th>出生日期</th>
			<th>工作</th>
			<th>专业</th>
			<th>经历</th>
			<th>学历</th>
			<th>毕业学校</th>
			<th>联系电话</th>
			<th>地址</th>
			<th>创建时间</th>
			<th>备注</th>
			<th>是否聘请</th>
			<th>操作</th>
		</tr>
		<%
			Object objj=request.getAttribute("list");
			Object objAll=session.getAttribute("inviteJobList");
			
			List<InviteJob> list=(List<InviteJob>) objj;
			List<InviteJob> listAll=(List<InviteJob>) objAll;
			//当前页
			Integer showPage=(Integer)session.getAttribute("showPage");
			//一页显示的记录
			int pageSize=4;
			int total=listAll.size();
			//总页数
			int totalPage = (total % pageSize == 0 ? total / pageSize : total / pageSize + 1);
			if(showPage<=1)
				showPage=1;
			if(showPage>totalPage)
				showPage=totalPage;
			for(InviteJob obj:list){
		%>
		
		
		
		
		<tr>
	     	<td><%=obj.getId() %></td>
	     	<td><%=obj.getName() %></td>
	     	<td><%=obj.getSex()%></td>
	     	<td><%=obj.getAge() %></td>
	     	<td><%=obj.getBorn() %></td>
	     	<td><%=obj.getJob()%></td>
	     	<td><%=obj.getSpecialty() %></td>
	     	<td><%=obj.getExperience() %></td>
	     	<td><%=obj.getEducation() %></td>
	     	<td><%=obj.getGraduateSchool()%></td>
	     	<td><%=obj.getTel()%></td>
	     	<td><%=obj.getAddress()%></td>
	        <td><%=obj.getCreateTime()%></td>
	     	<td><%=obj.getRemarks()%></td>
	     	<td><%=obj.getIsHire()%></td>
	     	<td>
	     		<a href="<%=request.getContextPath()%>/invitejob/alter_invite?inId=<%=obj.getId() %>">修改</a>
	     		&nbsp;&nbsp;
	     		<a href="<%=request.getContextPath() %>/invitejob/<%=obj.getId() %>/delete" onclick="return isDel()">删除</a>
	     	</td>
	     </tr>
		<%} %>
	</table>
		<span>第<%=showPage %>页/共<%=totalPage %>页</span>
		<a href="<%=request.getContextPath()%>/invitejob/limit?showPage=1">首页</a>
		&nbsp;&nbsp;
		<a href="<%=request.getContextPath()%>/invitejob/limit?showPage=<%=showPage-1 %>">上一页</a>
		&nbsp;&nbsp;
		<a href="<%=request.getContextPath()%>/invitejob/limit?showPage=<%=showPage+1 %>">下一页</a>
		&nbsp;&nbsp;
		<a href="<%=request.getContextPath()%>/invitejob/limit?showPage=<%=totalPage %>">尾页</a>
		<br>
		<form action="<%=request.getContextPath()%>/invitejob/limit">
			跳转到第
			<input type="text" name="showPage" id="showPage" size="2">页
			<input type="submit" value="GO" onclick="return checkinput()">
		</form>
		<h2>
			<a href="<%=request.getContextPath()%>/admin/function">返回功能页面</a>
		</h2>
</body>
</html>